package demo1;
// 浅拷贝

public class Test {
    public static void main(String[] args) throws CloneNotSupportedException{
      Person person1 = new Person("张三",10);
      Person person2 = (Person) person1.clone();
        System.out.println("修改前："+person1.money1.moneycount);
        System.out.println("修改前："+person2.money1.moneycount);

        person2.money1.moneycount = 20;
        System.out.println("修改后："+person1.money1.moneycount);
        System.out.println("修改后："+person2.money1.moneycount);

    }
}
